html(lang="zh-CN")
  head
    meta(http-equiv="Content-Type" content="text/html; charset=UTF-8")
    meta(http-equiv="X-UA-Compatible" content="IE=edge, chrome=1")
    meta(name="keywords" content="")
    meta(name="description" content="")
    meta(name="author" content="")
    meta(content="email=no" name="format-detection" )
    meta(name="format-detection" content="telephone=no" )
    meta(name="apple-touch-fullscreen" content="yes" )
    meta(name="apple-mobile-web-app-capable" content="yes" )
    meta(http-equiv="Content-Type" content="text/html;charset=UTF-8" )
    meta(name="apple-mobile-web-app-status-bar-style" content="black" )
    meta(name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no" )
    //- 公共样式
    link(rel="stylesheet" href="/mobile/dest/libs/pure/pure.min.css")
    link(rel="stylesheet" href="/mobile/dest/libs/pure/grids-responsive.min.css")
    link(rel="stylesheet" type="text/css" href="/mobile/dest/views/m_dict.form/dict.css")
    link(rel="stylesheet" type="text/css" href="/mobile/dest/css/comm.css")
    //- link(rel="icon" href="./favicon.ico" mce_href="./favicon.ico" type="image/x-icon" id="icoLink")
    //- link(rel="icon" href="" mce_href="" type="image/x-icon" id="icoLink")
    title
  body
    div(id="app1")
      .email-content
        //- 加载中
        .loadding(:class="loaddingClass")
          .load-txt 加载数据中...
          .load-ico

        //- 加载失败
        .loaded-fail(:class="loadedFailClass") {{loadedFail}}

        div(:class="loadedSuccClass")
          //- 显示标题
          .email-content-header.pure-g
            .pure-u-1
              h4.email-content-title 系统管理 / 字典管理

          //- 加载成功
          .email-content-body
            c-dialog(:dialogOption="dlgOpt")

            //- 操作选项卡
            .pure-menu.pure-menu-horizontal
              ul.pure-menu-list.c-tab-clear-fixed.c-tab-menu-width
                li.c-tab-pure-menu-item.c-menu-item-mgr(v-on:click.stop.prevent="tabsToggle(0);")
                  a.c-tab-menu-link(v-bind:class="{'pure-menu-selected': 0 == tab_active_idx}" href="javascript:;") 查询
                li.c-tab-pure-menu-item.c-menu-item-mgr(v-on:click.stop.prevent="tabsToggle(1);")
                  a.c-tab-menu-link(v-bind:class="{'pure-menu-selected': 1 == tab_active_idx}" href="javascript:;") 列表
                li.c-tab-pure-menu-item.c-menu-item-mgr.c-new-email-content-controls
                  button.pure-button-primary.pure-button.c-new-pure-button(v-on:click.stop.prevent="onAddDict();") 新增
                //- li.pure-menu-item.c-menu-item-mgr(v-bind:class="{'pure-menu-selected': 2 == tab_active_idx}" v-on:click.stop.prevent="tabsToggle(2);")
                //-   a.c-tab-menu-link(href="javascript:;") 编辑

            //- 查询选项卡
            .c-main.c-tab-clear-fixed(v-if="0 == tab_active_idx")
              c-zoom(v-bind:zoom-options ="zoomOpt" v-show="showZoom")

              form.pure-form.pure-form-aligned(novalidate="" v-show="!showComp")
                .pure-g.c-row
                  .pure-u-1.pure-u-md-1-2
                    .pure-g
                      label.pure-u.c-label 字典ID：
                      input.pure-u-16-24(type="text" v-model="dictQuery.dict_id" placeholder="请输入字典ID")

                  .pure-u-1.pure-u-md-1-2
                    .pure-g
                      label.pure-u.c-label 字典名称：
                      input.pure-u-16-24(type="text" v-model="dictQuery.dict_name" placeholder="请输入字典名称")

                .pure-g.c-row
                  .pure-u-1.c-button.c-query-padding
                    button.pure-button.pure-button-primary.c-query-pure-button(type="button" v-on:click.stop.prevent="onSearchDictList();") 查询
                    span.pure-u-1-24 &nbsp;
                    button.pure-button.pure-button-primary.c-reset-pure-button(type="button" v-on:click.stop.prevent="onReset();") 重置

              c-select-tree(v-bind:tree-options="treeOpt" v-show="showTree")
              c-upload-file(v-bind:upload-options="uploadOpt" v-if="showUpload")

            //- 列表选项卡
            .c-main.c-tab-clear-fixed(v-if="1 == tab_active_idx")
              #no-more-tables
                table.pure-table.pure-table-horizontal.c-table
                  thead
                    tr
                      th 字典ID
                      th 字典名称
                      th 操作

                  tbody
                    tr(v-for="(dict, idx) in dictList" v-bind:class="{'pure-table-odd': 0 != idx%2}")
                      td(data-title='字典ID') {{dict.dict_id}}
                      td(data-title='字典名称') {{dict.dict_name}}
                      td(data-title='操作')
                        a.c-cont-pure-button(href="javascript:;" v-on:click.stop.prevent="onEditDict(dict);") 编辑
                        span &nbsp;&nbsp;|&nbsp;&nbsp;
                        a.c-cont-pure-button(href="javascript:;" v-on:click.stop.prevent="onRemoveResouce(dict._id);") 删除

                //- 显示更多
                .c-view-more
                  a(v-if="isSearchDict==false" href='javascript:;' v-on:click.stop.prevent='getDictList(pageNum-1+2)')
                    span {{viewMoreText}}
                    span （{{pageNum}}
                    span &nbsp;/&nbsp;
                    span {{pageCount}}）
                  a(v-else href='javascript:;' v-on:click.stop.prevent='getSearchDictList(pageNum-1+2)')
                    span {{viewMoreText}}
                    span （{{pageNum}}
                    span &nbsp;/&nbsp;
                    span {{pageCount}}）

            //- 编辑选项卡
            .c-main.c-tab-clear-fixed(v-if="2 == tab_active_idx")
              c-zoom(v-bind:zoom-options ="zoomOpt" v-show="showZoom")

              form.pure-form.pure-form-aligned(v-show="!showComp" novalidate="")
                c-form-tips(:form-tips-option="formTipsOpt")

                .pure-g.c-row
                  .pure-u-1.pure-u-md-1-2
                    .pure-g
                      label.pure-u.c-label 字典ID：
                      input.pure-u-16-24(type="text" v-model="dictDetail.dict_id" required )
                      span.c-font-red *

                  .pure-u-1.pure-u-md-1-2
                    .pure-g
                      label.pure-u.c-label 字典名称：
                      input.pure-u-16-24(type="text" v-model="dictDetail.dict_name" required )
                      span.c-font-red *

                .pure-g.c-row
                  .pure-u-1
                    .c-op-bar
                      a.pure-button-primary.pure-button(href="javascript:;" v-on:click.stop.prevent="onAddDictItem($event);") 添加

                .pure-g.c-row(v-for="(dItem, idx) in dictDetail.dict_items")
                  .pure-u-1.pure-u-md-1-2
                    .pure-g
                      label.pure-u.c-label 文本：&nbsp;&nbsp;
                      input.pure-u-16-24(type="text" v-model="dItem.text"  required )
                      span.c-font-red *

                  .pure-u-1.pure-u-md-1-2
                    .pure-g
                      label.pure-u.c-label 值：&nbsp;&nbsp;&nbsp;
                      input.pure-u-12-24(type="text"  v-model="dItem.value"  required )
                      span.c-font-red *
                      .pure-u-4-24
                        a.pure-button-primary.pure-button(href="javascript:;" v-on:click.stop.prevent="onRemoveDictItem($event, idx);") 删除

                .pure-g.c-row
                  .pure-u-1.c-button.c-query-padding
                    button.pure-button.pure-button-primary.c-save-pure-button(type="button" v-on:click.stop.prevent="onSaveDict();") 保存

              c-select-tree(v-bind:tree-options="treeOpt" v-show="showTree")
              c-upload-file(v-bind:upload-options="uploadOpt" v-if="showUpload")

    //- 模块加载，入口配置
    script(type="text/javascript" src="/mobile/dest/libs/vue/vue.min.js")
    script(type="text/javascript" src="/mobile/dest/libs/vue/vue-resource.min.js")
    script(type="text/javascript" src="/mobile/dest/libs/jquery.min.js")
    script(type="text/javascript" src="/mobile/dest/views/m_dict.form/dict.js")